<template>
  <div>
    <el-row>
      <el-col :span="10">
        <el-button icon="el-icon-plus">
          新增客户
        </el-button>
      </el-col>
      <el-col :span="5">
        <el-col :span="1.5">
          <el-button>
            全部
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button >
            启用
          </el-button>
        </el-col>
        <el-col :span="1.5">
          <el-button>
            禁用
          </el-button>
        </el-col>
      </el-col>
      <el-col :span="5">
        <el-form :inline="true" class="demo-form-inline" style="margin-right: 10px">
          <el-form-item>
            <el-input v-model=input placeholder="请输入客户名称、信用代码"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary">查询</el-button>
          </el-form-item>
        </el-form>
      </el-col>
      <el-col :span="2">
        <el-button circle icon="el-icon-refresh"></el-button>
      </el-col>
    </el-row>
    <div>
      <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column label="操作" width="210">
          <template slot-scope="scope">
            <el-button
              class="el-icon-search" circle></el-button>
            <el-button
              class="el-icon-edit" circle></el-button>
          </template>
        </el-table-column>
        <el-table-column
          label="序号"
          width="80">
          <template slot-scope="scope">
            <span
            >{{scope.$index+1}}
            </span>
          </template>
        </el-table-column>
        <el-table-column
          prop="account"
          label="业务员名称"
          width="180">
        </el-table-column>
        <el-table-column
          prop="mobile"
          label="电话号码"
          width="280">
        </el-table-column>
        <el-table-column
          prop="email"
          label="邮箱"
          width="280">
        </el-table-column>
        <el-table-column
          prop="state"
          label="状态"
          width="180">
          <template slot-scope="scope">
            <el-switch
              class="switch"
              active-text="开启"
              inactive-text="禁用"
              active-color="#13ce66"
              inactive-color="#ff4949"
              v-model="scope.row.state"
            >
            </el-switch>
          </template>
        </el-table-column>
        <el-table-column
          prop="addtime"
          label="添加日期"
          width="180">
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: "salesermanage",
  data() {
    return {
      tableData:[],
      input:''
    };
  },
  methods:{
    findsales(){
      this.axios.get(this.baseUrl + "sale/findUsersByRole/销售人员")
        .then(res => {
          this.tableData=res.data.data
          console.log()
        })
    }
  },
  created() {
    this.findsales();
  }
}
</script>


<style scoped lang="less">
@import "../../assets/css/element-ui.css";
</style>

